package org.doc.noliferadio.stuff;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import javax.swing.JPanel;

public class GhostPanel extends JPanel {

    public static Point start = new Point(0, 0);
    public static Point end = new Point(0, 0);

    public GhostPanel() {
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.clearRect(0, 0, getWidth(), getHeight());
        g.setColor(Color.red);
        g.drawLine(start.x, start.y, end.x, start.y);
        g.drawString(Math.abs(end.x - start.x) + " px", start.x + 1, start.y - 5);
        repaint();
    }
}
